//  Abstract:
//    GUI handler for metadata dialog
//
//  Reference:
//
//  Design Notes:
//
//  Disclaimer:
//    Copyright (C) 2008, Janice Law <janicel700@gmail.com>.
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
//
#include <libglademm.h>
#include <gtkmm.h>
#include <boost/shared_ptr.hpp>
#include "ocf.h"
#include "opf.h"

using Glib::RefPtr;
using namespace boost;

namespace gopsed
{
class ContentColumns : public Gtk::TreeModelColumnRecord
{
    public:
        ContentColumns()
        {
            add(m_content);
            add(m_attr1);
            add(m_attr2);
        }
        Gtk::TreeModelColumn<Glib::ustring> m_content;
        Gtk::TreeModelColumn<Glib::ustring> m_attr1;
        Gtk::TreeModelColumn<Glib::ustring> m_attr2;
        int column_count;
};

class DetailWindow
{
    public:
        DetailWindow(const RefPtr<Gnome::Glade::Xml>& glade_xml);
        void on_edited(const ustring& path, const ustring& new_text);
        Epub::Opf::ustring_1_list show(Epub::Opf::ustring_1_list param);
        Epub::Opf::ustring_2_list show(const ustring attrName1,
                Epub::Opf::ustring_2_list param);
        Epub::Opf::ustring_3_list show(const ustring attrName1,
                const ustring attrName2, Epub::Opf::ustring_3_list param);
    protected:
        RefPtr<Gnome::Glade::Xml> glade;
        Gtk::Dialog* dialog;
        Gtk::ScrolledWindow* container;
        ContentColumns columns;
        Gtk::TreeView* treeview;
        RefPtr<Gtk::ListStore> liststore;
};
} // gopsed
